package com.zking.utils.廖全箐;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 按钮的监听
 */
public class ButtonListener implements ActionListener{

    //父面板
    private Order order;

    public ButtonListener(Order order ) {
        this.order = order;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        //就是活动的这个组件
        JButton jbt = (JButton) e.getSource();
        switch (jbt.getText()) {
            case "增加":
                System.out.println("你点击了增加"+order.getPn());
                break;
            case "删除":
                System.out.println("你点击了删除");
                break;
            case "更新":
                System.out.println("你点击了更新");
                break;
            case "刷新":
                System.out.println("你点击了刷新");
                break;
            case "上一页":
                System.out.println("你点击了上一页");
                break;
            case "下一页":
                System.out.println("你点击了下一页");
                break;
        }
    }
}
